{%  if bgp_peers is defined %}
protocols {
{#
**************************************************
###         BGP  Variables                  ######
**************************************************
#}
    bgp {
        group Core {
            type internal;
            local-address {{ lo_ip[inventory_hostname] | ipaddr('address')}};
{%          if bgp_topo.rr == inventory_hostname %}
            cluster {{ lo_ip[inventory_hostname].split('/')[0] }};
{%          endif %}
{%          for af in bgp_topo.af %}
{%          if af == 'inet' %}
            family inet {               
                unicast;
            }
{%          endif %}
{%          if af == 'inet-vpn' %}
            family inet-vpn {
                unicast;
            }
{%          endif %}
{%          if af == 'evpn' %}
            family evpn {
                signaling;
            }
{%          endif %}
{%          endfor %}
{%          for p in bgp_peers %}
            neighbor {{ p.peer}};
{%          endfor %}
        }
    }
}
{%  endif %}
